﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InformSms.aspx.cs" Inherits="GovernmentOfficeProject.LevelViewUI.information.InformSms" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>短信通知</title>
    <script type="text/javascript" src="/lib/easyui/jquery-1.8.0.min.js"></script> 
<script type="text/javascript">
    $(document).ready(function() {
        $("#mainContainer").css("height", document.documentElement.clientHeight);
    });

    function doResize() {
        $("#mainContainer").css("height", document.documentElement.clientHeight);
    }
    
    function setSyncSmsPreview() {
//        if (window.event.keyCode == 32) {
//            event.returnValue = false;
//        }
//        if (window.event.keyCode == 13) {
//            event.returnValue = false;
//        }
        if (document.getElementById("txtSmsContent").value.length > 60) {
            var beyondCount = 60 - document.getElementById("txtSmsContent").value.length;
            document.getElementById("lblSmsContentCount").innerText = "已超过字符数限制" + beyondCount + ",请修改通知内容."
            document.getElementById("lblSmsContentCount").style.color = "red";
        }
        else {
            if (document.getElementById("txtSmsContent").value.length > 0) {
//                var p = /\s/g
                var strContent = document.getElementById("txtSmsContent").value;
//                strContent = strContent.replace(p, "");
//                document.getElementById("txtSmsContent").value = strContent;                
                var str = '政府办信息系统通知:' + document.getElementById("txtSmsContent").value;
//                str = str.replace(p,"");
                document.getElementById("lblSmsPreview").innerText = str;
            }
            else {
                document.getElementById("lblSmsPreview").innerText = '政府办信息系统通知:';
            }
            document.getElementById("lblSmsContentCount").style.color = "blue";
            document.getElementById("lblSmsContentCount").innerText = "已输入" + document.getElementById("txtSmsContent").value.length + "个字符";
        }
    }
</script>
<script language="javascript">
    document.onkeydown   =   function()   
    {           
          if(event.keyCode   ==   13)   
          {   
                  if(event.srcElement.tagName.toLowerCase()   !=   "input")   
                  event.returnValue   =   false;   
          }   
    }
</script>

<style type="text/css">
        a{text-decoration: none;}
        a:hover{ text-decoration:none}
</style>
    <style type="text/css">
        .style1
        {
            height: 18px;
            font-weight: bold;
        }
        .style3
        {
            width: 406px;
        }
        #formSmsInform
        {
            height: 582px;
        }
        .style4
        {
            width: 406px;
            height: 190px;
        }
        .style13
        {
            width: 20px;
            font-weight: bold;
        }
        .style14
        {
            width: 20px;
            height: 190px;
            font-weight: bold;
        }
        .style17
        {
            height: 190px;
            font-weight: bold;
        }
        .style18
        {
            height: 190px;
        }
        .style19
        {
            width: 20px;
            font-weight: bold;
            height: 102px;
        }
        .style20
        {
            height: 102px;
        }
        .style21
        {
            width: 20px;
            font-weight: bold;

        }
        .style22
        {
            height: 71px;
        }
        </style>
</head>
<body onresize="doResize()">
    <form id="formSmsInform" runat="server" style="width: 100%; height: 100%">
 <asp:ScriptManager ID="ScriptManager" runat="server">
</asp:ScriptManager>
     <div id="mainContainer" style="width: 100%;overflow:auto;">
    
        <table style="border: medium inset #0000FF; width: 738px; height: 450px; font-size: small;" 
             border="0" frame="border" width="100%">
            <tr>
                <td align="center" class="style1" 
                    style="border: thin ridge #3399FF; font-size: small;" colspan="2" 
                    bgcolor="#CCCCCC">
                    <div>
                        选择联系人</div>
                </td>
                <td align="center" class="style1" 
                    style="border: thin ridge #3399FF; font-size: small;" colspan="2" 
                    bgcolor="#CCCCCC">
                    <div >
                        短信通知操作</div></td>
            </tr>
            <tr>
                <td rowspan="2" 
                    style="border: thin ridge #3399FF; text-align: right; vertical-align: middle; width: 20px;" 
                    class="style13">
                    个人通讯簿</td>
                <td class="style3" rowspan="2" 
                    style="border: thin ridge #3399FF; text-align: left; vertical-align: top;">
<asp:UpdatePanel ID="upGVPersonal" runat="Server">
<ContentTemplate>
                    <div style="font-size: small">
                    &nbsp;<asp:Label ID="Label1" runat="server" Text="姓 名:"></asp:Label>
&nbsp;<asp:TextBox ID="txtPersonalFindName" runat="server" Font-Size="Small" Height="16px" Width="90px"></asp:TextBox>
                    &nbsp;<asp:LinkButton ID="lBtnPersonalFind" runat="server" Font-Size="Small" 
                            onclick="lBtnPersonalFind_Click">查 找</asp:LinkButton>
&nbsp;<asp:LinkButton ID="lBtnPersonalALL" runat="server" Font-Size="Small" 
                            onclick="lBtnPersonalALL_Click">全 部</asp:LinkButton>
                        <asp:Label ID="label" runat="server" Font-Bold="True" Font-Size="Small" 
                            ForeColor="#3399FF" style="font-weight: 700" Width="107px" Height="16px"></asp:Label>
                        &nbsp;<asp:Label ID="lblPerOperation" runat="server" Font-Bold="True" 
                            Font-Size="Small" ForeColor="#3399FF" style="font-weight: 700"></asp:Label>
                    </div>
                    <div style="height: 160px; width: 403px; " >
                    <div id="divGVPersonal" runat="server" ></div>
                        <asp:GridView ID="GridViewPersonal" runat="server" AutoGenerateColumns="False" 
                            Height="90%" Width="100%" Font-Size="Small" BackColor="White" 
                            BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="0" 
                            AllowPaging="True" onpageindexchanging="GridViewPersonal_PageIndexChanging" 
                            PageSize="6">
                            <PagerSettings Mode="NumericFirstLast" Position="Top" />
                            <RowStyle ForeColor="#000066" />
                            <Columns>
                                <asp:BoundField HeaderText="姓 名" DataField="SmsInfoName">
                                <HeaderStyle Height="15px" />
                                <ItemStyle Width="100px" HorizontalAlign="Center" />
                                </asp:BoundField>
                                <asp:BoundField HeaderText="单位/部门" DataField="SmsInfoDeptName" >
                                <ItemStyle Width="150px" HorizontalAlign="Center" />
                                </asp:BoundField>
                                <asp:BoundField HeaderText="手机号码" DataField="SmsInfoMobileNumber">
                                <HeaderStyle Height="15px" />
                                <ItemStyle Width="90px" HorizontalAlign="Center" />
                                </asp:BoundField>
                                <asp:TemplateField HeaderText="选择">
                                    <ItemTemplate>
                                        <asp:CheckBox ID="CheckBoxSelectedPersonal" runat="server" 
                                            oncheckedchanged="CheckBoxSelectedPersonal_CheckedChanged" 
                                            AutoPostBack="True" Checked='<%# bind("SmsInfoSelected") %>' />
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:TemplateField>
                            </Columns>
                            <FooterStyle BackColor="White" ForeColor="#000066" />
                            <PagerStyle BackColor="#CCFF33" ForeColor="#000066" HorizontalAlign="Center" 
                                Font-Size="Small" />
                            <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
                        </asp:GridView>
                    </div>
</ContentTemplate>
</asp:UpdatePanel> 
                </td>
                <td style="border: thin ridge #3399FF; text-align: right; vertical-align: middle;" 
                    class="style21">
                    短信预览</td>

                <td style="border: thin ridge #3399FF; text-align: left; vertical-align: top;" 
                    class="style22">
<asp:UpdatePanel ID="UPSMSView" runat="Server">
<ContentTemplate>
                    <div style="height: 100%; font-size: small; width: 98%;">
                        <asp:Label ID="lblSmsPreview" runat="server" BackColor="#CCFFFF" BorderColor="#3399FF" 
                            BorderStyle="Inset" Height="68px" 
                            Text="政府办通知:" 
                            Width="242px" style="font-weight: 700"></asp:Label>
                    </div>
</ContentTemplate>
</asp:UpdatePanel> 
                </td>                
            </tr>
            <tr>
                <td style="border: thin ridge #3399FF; text-align: right; vertical-align: middle; " 
                    class="style19">
                    短信内容</td>
                <td style="border: thin ridge #3399FF; text-align: left; vertical-align: top;" 
                    class="style20">
<asp:UpdatePanel ID="UPSMSContent" runat="Server">
<ContentTemplate>
                    <div>
                        <asp:Label ID="Label7" runat="server" Font-Size="Small" Text="输入内容(最多60字):"></asp:Label>
                    </div>
                    <div style="height: 67px; width: 250px">
                        <asp:TextBox ID="txtSmsContent" runat="server" Font-Size="Small" Height="100%" 
                            MaxLength="60" TextMode="MultiLine" ToolTip="发送通知的内容" Width="97%" 
                            AutoPostBack="false" onkeyup="setSyncSmsPreview()" onkeydown="setSyncSmsPreview()"
                            onchange="setSyncSmsPreview()" onkeypress="setSyncSmsPreview()" onmousedown="setSyncSmsPreview()" 
                            onselect="setSyncSmsPreview()" 
                              ></asp:TextBox>
                    <div>
                        <asp:Label ID="lblSmsContentCount" runat="server" Font-Size="Small" 
                            Text="" ForeColor="Blue"></asp:Label>
                    </div>
                    </div>
</ContentTemplate>
</asp:UpdatePanel> 
                </td>
            </tr>
            <tr>
                <td class="style14" style="border: thin ridge #3399FF; text-align: right; vertical-align: middle; ">
                    系统通讯簿</td>
                <td class="style4" 
                    style="border: thin ridge #3399FF; text-align: left; vertical-align: top;">
<asp:UpdatePanel ID="upGVSYS" runat="Server">
<ContentTemplate>
                    <div>                    
                        &nbsp;<asp:Label ID="Label3" runat="server" Text="姓 名:"></asp:Label>
&nbsp;<asp:TextBox ID="txtSysFindName" runat="server" Font-Size="Small" Height="16px" Width="90px"></asp:TextBox>
                    &nbsp;<asp:LinkButton ID="lBtnSysFind" runat="server" Font-Size="Small" 
                            onclick="lBtnSysFind_Click">查 找</asp:LinkButton>
&nbsp;<asp:LinkButton ID="lBtnSysFindALL" runat="server" Font-Size="Small" 
                            onclick="lBtnSysFindALL_Click">全 部</asp:LinkButton>
                        &nbsp;&nbsp;<asp:DropDownList ID="ddlSysDeptSelect" runat="server" Height="18px" 
                            Width="101px" 
                            onselectedindexchanged="ddlSysDeptSelect_SelectedIndexChanged" 
                            AutoPostBack="True" Enabled="False">
                            <asp:ListItem Selected="True">选择部门用户</asp:ListItem>
                        </asp:DropDownList>
                        &nbsp;<asp:Label ID="lblSysOperation" runat="server" Font-Bold="True" 
                            Font-Size="Small" ForeColor="#3399FF" style="font-weight: 700"></asp:Label>
                    </div>
                    <div style="height: 148px; width: 403px; ">
                        <div id="divGVSYS" runat="server" ></div>
                        <asp:GridView ID="GridViewSys" runat="server" AutoGenerateColumns="False" 
                            Height="98%" Width="99%" 
                            onrowdatabound="GridViewSys_RowDataBound" Font-Size="Small" 
                            BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" 
                            CellPadding="0" AllowPaging="True" 
                            PageSize="6" onpageindexchanging="GridViewSys_PageIndexChanging">
                            <PagerSettings Mode="NumericFirstLast" Position="Top" />
                            <RowStyle ForeColor="#000066" />
                            <Columns>
                                <asp:BoundField HeaderText="姓 名" DataField="SmsInfoName">
                                <HeaderStyle Height="15px" />
                                <ItemStyle Width="100px" HorizontalAlign="Center" />
                                </asp:BoundField>
                                <asp:TemplateField HeaderText="单位/部门">
                                    <ItemTemplate>
                                        <asp:DropDownList ID="DropDownListSysShowDept" runat="server" Font-Size="Small" 
                                            Width="100%" Height="100%">
                                        </asp:DropDownList>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox1" runat="server" 
                                            Text='<%# Bind("SmsInfoDeptNameList") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemStyle Width="150px" HorizontalAlign="Center" />
                                </asp:TemplateField>
                                <asp:BoundField HeaderText="手机号码" DataField="SmsInfoMobileNumber">
                                <HeaderStyle Height="15px" />
                                <ItemStyle Width="90px" HorizontalAlign="Center" />
                                </asp:BoundField>
                                <asp:TemplateField HeaderText="选择">
                                    <ItemTemplate>
                                        <asp:CheckBox ID="CheckBoxSysUserSelect" runat="server" 
                                            oncheckedchanged="CheckBoxSysUserSelect_CheckedChanged" 
                                            AutoPostBack="True" Checked='<%# bind("SmsInfoSelected") %>' />
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:TemplateField>
                            </Columns>
                            <FooterStyle BackColor="White" ForeColor="#000066" />
                            <PagerStyle BackColor="#CCFF33" ForeColor="#000066" HorizontalAlign="Center" 
                                Font-Size="Small" />
                            <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
                        </asp:GridView>
                    </div>
</ContentTemplate>
</asp:UpdatePanel>   
                </td>
                <td 
                    style="border: thin ridge #3399FF; text-align: right; vertical-align: middle; " 
                    class="style17">
                    通知人员列表</td>
                <td 
                    style="border: thin ridge #3399FF; text-align: left; vertical-align: top;" 
                    class="style18">
<asp:UpdatePanel ID="UPInformPersonnel" runat="Server">
<ContentTemplate>
                    <div style="height: 175px; width: 249px; overflow: auto;">
                    <div id="divGVPersonnel" runat="server" ></div>
                        <asp:GridView ID="GridViewInformPersonnel" runat="server" AutoGenerateColumns="False" 
                            Height="100%" Width="100%" Font-Size="Small" BackColor="White" 
                            BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="0" 
                            PageSize="8">
                            <RowStyle ForeColor="#000066" />
                            <Columns>
                                <asp:BoundField HeaderText="姓 名" DataField="smsInfoName">
                                <HeaderStyle Height="15px" />
                                <ItemStyle Width="100px" HorizontalAlign="Center" />
                                </asp:BoundField>
                                <asp:BoundField HeaderText="手机号码" DataField="smsInfoMobileNumber">
                                <HeaderStyle Height="15px" />
                                <ItemStyle Width="90px" HorizontalAlign="Center" />
                                </asp:BoundField>
                                <asp:TemplateField HeaderText="操作">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LinkButtonCancelPersonnel" runat="server" Font-Bold="True" 
                                            Font-Size="Medium" ToolTip="取消联系人" ForeColor="Red" 
                                            onclick="LinkButtonCancelPersonnel_Click">×</asp:LinkButton>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:TemplateField>
                            </Columns>
                            <FooterStyle BackColor="White" ForeColor="#000066" />
                            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                            <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
                        </asp:GridView>
                    </div>
</ContentTemplate>
</asp:UpdatePanel> 
                </td>
            </tr>
            <tr>
                <td 
                    style="border: thin ridge #3399FF; text-align: right; vertical-align: middle; width: 20px;" 
                    class="style13">

                    自定义</td>
                <td class="style3" style="border: thin ridge #3399FF; text-align: left; vertical-align: middle;">
<asp:UpdatePanel ID="UPCustomAdd" runat="Server">
<ContentTemplate>
                    <div style="text-align:center">
                    <asp:Label ID="lblCustomAddState" runat="server" Font-Bold="True" Font-Size="Small" 
                            ForeColor="#3399FF" style="font-weight: 700" Text=""></asp:Label>
                    </div>
                    <div>
                    &nbsp;
                        <asp:Label ID="Label4" runat="server" Text="姓 名:"></asp:Label>
                        <asp:TextBox ID="txtCustomName" runat="server" Font-Size="Small" Height="16px" 
                            Width="90px"></asp:TextBox>
                    &nbsp;<asp:Label ID="Label5" runat="server" Text="手机:"></asp:Label>
                        <asp:TextBox ID="txtCustomPhoneNumber" runat="server" Font-Size="Small" Height="16px" 
                            Width="118px"
                            onkeyup="this.value=this.value.replace(/[^\d]+?/g,'')"></asp:TextBox>
                    &nbsp;
                        <asp:LinkButton ID="lBtnCustomADD" runat="server" Font-Size="Small" 
                            onclick="lBtnCustomADD_Click" 
                            >增 加</asp:LinkButton>
                    </div>
</ContentTemplate>
</asp:UpdatePanel>
                </td>
                <td 
                    style="border: thin ridge #3399FF; text-align: right; vertical-align: middle; width: 20px;" 
                    class="style13">
                    操<br />&nbsp;作</td>
                <td  style="border: thin ridge #3399FF; text-align: center; vertical-align: bottom;">
<asp:UpdatePanel ID="UPOperation" runat="Server">
<ContentTemplate>
                      <div style="height: 16px; width: 246px; vertical-align: middle; text-align: center;">
                      <asp:Label ID="lblOperationState" runat="server" Font-Bold="True" Font-Size="Small" 
                            ForeColor="#3399FF" style="font-weight: 700" Text="操作状态" Width="244px"></asp:Label> 
                       </div>
                    <div style="height: 20px; width: 246px; vertical-align: middle; text-align: center;">                        
                        &nbsp;
                        <asp:Button ID="btnSendSms" runat="server" Font-Bold="True" 
                            Font-Size="Small" Height="21px" onclick="btnSendSms_Click" Text="发 送" 
                            Width="56px" CausesValidation="False" Enabled="False" />
                        <asp:CheckBox ID="ckbSendButtonState" runat="server" AutoPostBack="True" 
                            Font-Size="11px" ForeColor="#FF9933" 
                            oncheckedchanged="ckbSendButtonState_CheckedChanged" Text="安全锁" />
                        <asp:Label ID="lbl1" runat="server" Font-Bold="True" Font-Size="Small" 
                            ForeColor="#3399FF" style="font-weight: 700"  Height="16px"></asp:Label>                        
                        <asp:Button ID="btnCancelSms" runat="server" Font-Bold="False" Font-Size="Small"                             
                            Height="21px" onclick="btnCancelSms_Click" Text="取 消" Width="56px" 
                            CausesValidation="False" 
                            onclientclick="javascript:return confirm('是否确定初始化页面？')" 
                            style="font-weight: 700" TabIndex="1" />
                    </div>
</ContentTemplate>
</asp:UpdatePanel>
                </td>
            </tr>
        </table>
            &nbsp;</div>
    </form>

</body>
</html>
